package cn.tedu.ivos.user.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
//value object 用于让ssm项目将mysql的查询结果返回给controller
//controller以jsonResult对象的形式返回给页面
//(本项目是将mybatis查询的结果封装为UserVO，再传递给service，再传递给controller，controller以jsonResult对象的形式返回给页面)，
//注：vo将数据传递给前端页面可能会用到user表的所有数据，所以字段和entity.User字段一模一样。

@Data
public class UserVO {
    //Knife4j的注解。用来解释此字段的作用
    private Long id;
    private String username;
    private String password;
    private String email;
    private String phone;
    private Integer age;
    private String gender;
    //http协议只能传输字符串不能传输Data对象，
    //所以需要将Data类型的对象调用方法转化为String格式
    //(日期格式化,用@JsonFormat将Date格式转化为json字符串)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    private String status;
    private String level;
    private Long parentId;
}
/*    @ApiModelProperty(value = "用户id")
    private Long id;
    @ApiModelProperty(value = "用户名")
    private String username;
    @ApiModelProperty(value = "密码")
    private String password;
    @ApiModelProperty(value = "邮箱")
    private String email;
    @ApiModelProperty(value = "手机号")
    private String phone;
    @ApiModelProperty(value = "年龄")
    private Integer age;
    @ApiModelProperty(value = "性别")
    private String gender;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    @ApiModelProperty(value = "用户状态")
    private String status;
    @ApiModelProperty(value = "用户职级")
    private String level;
    @ApiModelProperty(value = "上级id")
    private Long parentId;
}*/